feat(libs_langfuse): Add UpdateTrace api#698
Open
kayoch1n wants to merge 7 commits intocloudwego:mainfrom
Open
feat(libs_langfuse): Add UpdateTrace api#698kayoch1n wants to merge 7 commits intocloudwego:mainfrom
kayoch1n wants to merge 7 commits intocloudwego:mainfrom
Conversation
Contributor
Author
|
Hi, @mrh997 是否方便review一下?目前langfuse上面的trace不显示 input和output;这里添加UpdateTrace之后,后续就可以更新 trace 的 input和output了 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
feat: A new feature
Check the PR title.
(Optional) Translate the PR title into Chinese.
langfuse 增加一个名为 UpdateTrace 的 API
(Optional) More detailed description for this PR(en: English/zh: Chinese).
en: There is no event type named "trace-update". According to the langfuse api docs the only way to update a trace is to fire an event of type "trace-create" again with the same body id, while using a separate event id.
zh(optional): langfuse并没有名为
trace-update的API;langfuse的官方文档建议用同样的trace id调用trace-create来达到更新trace的目的。所以这里新添加的UpdateTrace其实调用的还是trace-create(Optional) Which issue(s) this PR fixes:
跟 #533 有关。在当前PR添加了UpdateTrace api之后,后续PR就能使用这个接口函数更新trace的input和output。
至于为什么不直接使用 CreateTrace,是考虑到单元测试中已经存在mock CreateTrace;直接用 CreateTrace会对单测有影响,而且也不够直观。
callbacks 更新trace input和output的代码已经实现了,需要在这个 pr 合入之后再提pr
(optional) The PR that updates user documentation: